<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" layout:decorate="main"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">
<head>
    <title>客户修改</title>
    <link th:href="@{/localcss/crmlist.css}" href="../static/localcss/crmadd.css" rel="stylesheet">
    <style type="text/css">
        table tr{
            line-height: 40px;
        }
        table tr td{
            text-align: center;
        }
    </style>
</head>
<body>
<div layout:fragment="content">
    <div class="">
    <div class="clearfix"></div>
    <div class="row">
        <div class="col-md-12 col-sm-12 col-xs-12">
            <div class="x_panel">
                <div class="x_title">
                    <h2>修改客户信息 <i class="fa fa-user"></i></h2>
                    <div class="clearfix"></div>
                </div>
                <div class="x_content">
                    <form class="form-horizontal form-label-left" th:action="@{/customer/update}" action="/customer/update" method="post">
                        <table width="100%">
                            <tr>
                                <td>客户名称：</td>
                                <td>
                                    <input  class="form-control" name="custName" th:value="${customer.custName}" />
                                </td>
                                <td>客户编号：</td>
                                <td>
                                    <input class="form-control" name="custNo" th:value="${customer.custNo}" />
                                </td>
                            </tr>
                            <tr>
                                <td>地区：</td>
                                <td>
                                    <select class="form-control" name="custRegion">
                                        <option value="">-请选择-</option>
                                        <option th:each="reg:${regionList}"
                                                th:value="${reg.dictItem}"
                                                th:text="${reg.dictItem}"
                                                th:selected="${reg.dictItem eq customer.custRegion}">地区</option>
                                    </select>
                                </td>
                                <td>负责人：</td>
                                <td>
                                    <input class="form-control" name="custManagerName" th:value="${customer.custManagerName}"  />
                                </td>
                            </tr>
                            <tr>
                                <td>客户等级：</td>
                                <td>
                                    <select class="form-control" name="custLevelLabel">
                                        <option value="">--请选择--</option>
                                        <option th:selected="${level.dictItem eq customer.custLevelLabel}"
                                                th:each="level:${levelList}"
                                                th:value="${level.dictItem}"
                                                th:text="${level.dictItem}" value="">等级</option>
                                    </select>
                                </td>
                                <td>客户信誉度：</td>
                                <td>
                                    <select class="form-control" name="custCredit">
                                        <option value="">--请选择--</option>
                                        <option value="1" th:selected="${customer.custCredit==1}">☆</option>
                                        <option value="2" th:selected="${customer.custCredit==2}">☆☆</option>
                                        <option value="3" th:selected="${customer.custCredit==3}">☆☆☆</option>
                                        <option value="4" th:selected="${customer.custCredit==4}">☆☆☆☆</option>
                                        <option value="5" th:selected="${customer.custCredit==5}">☆☆☆☆☆</option>
                                    </select>
                                </td>
                            </tr>
                            <tr>
                                <td>客户满意度：</td>
                                <td>
                                    <select class="form-control" name="custSatisfy">
                                        <option value="">--请选择--</option>
                                        <option value="1" th:selected="${customer.custSatisfy==1}">☆</option>
                                        <option value="2" th:selected="${customer.custSatisfy==2}">☆☆</option>
                                        <option value="3" th:selected="${customer.custSatisfy==3}">☆☆☆</option>
                                        <option value="4" th:selected="${customer.custSatisfy==4}">☆☆☆☆</option>
                                        <option value="5" th:selected="${customer.custSatisfy==5}">☆☆☆☆☆</option>
                                    </select>
                                </td>
                                <td></td>
                                <td></td>
                            </tr>
                        </table>
                        <hr />
                        <table width="100%">
                            <tr>
                                <td style="width: 165px;">地址：</td>
                                <td>
                                    <input  class="form-control" name="custAddr" th:value="${customer.custAddr}"  />
                                </td>
                                <td style="width: 165px;">邮政编码：</td>
                                <td>
                                    <input class="form-control" name="custZip" th:value="${customer.custZip}" />
                                </td>
                            </tr>
                            <tr>
                                <td>电话：</td>
                                <td>
                                    <input class="form-control" name="custTel" th:value="${customer.custTel}" />
                                </td>
                                <td>传值：</td>
                                <td>
                                    <input class="form-control" name="custFax" th:value="${customer.custFax}" />
                                </td>
                            </tr>
                            <tr>
                                <td>网址：</td>
                                <td>
                                    <input class="form-control" name="custWebsite" th:value="${customer.custWebsite}" />
                                </td>
                                <td></td>
                                <td></td>
                            </tr>
                        </table>
                        <hr />
                        <table width="100%">
                            <tr>
                                <td style="width: 165px;">营业执照注册号：</td>
                                <td>
                                    <input  class="form-control" name="custLicenceNo" th:value="${customer.custLicenceNo}" />
                                </td>
                                <td style="width: 165px;">法人：</td>
                                <td>
                                    <input class="form-control" name="custChieftain" th:value="${customer.custChieftain}" />
                                </td>
                            </tr>
                            <tr>
                                <td>注册资金（万元）：</td>
                                <td>
                                    <input class="form-control" name="custBankroll" th:value="${customer.custBankroll}" />
                                </td>
                                <td>年营业额：</td>
                                <td>
                                    <input class="form-control" name="custTurnover" th:value="${customer.custTurnover}" />
                                </td>
                            </tr>
                            <tr>
                                <td>开户银行：</td>
                                <td>
                                    <input class="form-control" name="custBank" th:value="${customer.custBank}" />
                                </td>
                                <td>银行账号：</td>
                                <td>
                                    <input class="form-control" name="custBankAccount" th:value="${customer.custBankAccount}" />
                                </td>
                            </tr>
                            <tr>
                                <td>地税登记号：</td>
                                <td>
                                    <input class="form-control" name="custLocalTaxNo" th:value="${customer.custLocalTaxNo}" />
                                </td>
                                <td>国税登记号</td>
                                <td>
                                    <input class="form-control" name="custNationalTaxNo" th:value="${customer.custNationalTaxNo}" />
                                </td>
                            </tr>
                        </table>
                        <div class="form-group" style="text-align: center;margin-top: 20px">
                            <button type="button" th:onclick="linkman([[${customer.custNo}]])" class="btn btn-danger">联系人</button>
                            <button type="button" th:onclick="activity([[${customer.custNo}]])" class="btn btn-danger">交往记录</button>
                            <button id="send" type="button" th:onclick="orders([[${customer.custNo}]])" class="btn btn-danger">历史订单</button>
                            <button type="button" class="btn btn-primary" id="back">返回</button>
                            <button  type="submit" class="btn btn-dark">保存</button>
                        </div>
                        <br/>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
</div>
</body>
<script layout:fragment="js">
    $(document).ready(function(){
        $("#back").on("click",function(){
            window.history.back();
        });
    });
    function linkman(custNo) {
        location.href="/linkman/list?lkmCustNo="+custNo;
    }
    function activity(custNo) {
        location.href="/activity/list?atvCustNo="+custNo;
    }
    function orders(custNo) {
        location.href="/orders/list?odrCustomer="+custNo;
    }
</script>
</html>